
cmake_minimum_required(VERSION 3.30)

# =============================================================================
# 使用 define_property 定义一个属性喵
# define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE | TEST | VARIABLE | CACHED_VARIABLE> # 设置属性的范围
#   PROPERTY <name> # 属性的名称
#   [INHERITED] # 继承自高级作用域的属性。指定之后，获取属性在本级作用域未查到时，会从更高的作用域查找
#   [BRIEF_DOCS <brief-doc> [docs...]] # 属性的简介文档
#   [FULL_DOCS <full-doc> [docs...]] # 属性的完整文档
#   [INITIALIZE_FROM_VARIABLE <variable>]) # 从变量初始化，只用于 TARGET 的属性
define_property(DIRECTORY PROPERTY FOR_TEST_PROP BRIEF_DOCS "New custom property for test!")

# =============================================================================
# 使用 set_property 设置属性的值喵
# set_property(<
#     GLOBAL |
#     DIRECTORY [<dir>] |
#     TARGET [<target1> ...] |
#     SOURCE [<src1> ...]
#       [DIRECTORY <dirs> ...]
#       [TARGET_DIRECTORY <targets> ...] |
#     INSTALL [<file1> ...] |
#     TEST [<test1> ...]
#       [DIRECTORY <dir>] |
#     CACHE [<entry1> ...]
#   > # 前面都是属性的作用域喵
#   [APPEND] [APPEND_STRING] # APPEND 按列表追加， APPEND_STRING 按字符串追加
#   ROPERTY <name> [<value1> ...]) # 属性名称和值喵
set_property(DIRECTORY PROPERTY FOR_TEST_PROP "TestProp!")

set(Var_For_Test_Prop "此变量用于测试 get_directory_property 命令获取变量喵！")

message("属性设置完毕喵！")
